package client;

import afterVote.AfterVotePanelDescriptor;
import prevote.PreVotePanelDescriptor;
import publicate.PublicateResultsPanelDescriptor;
import registration.PersonalDataPanelDescriptor;
import registration.RegistrationCompletePanelDescriptor;
import vote.VotePanelDescriptor;
import wizard.Wizard;
import wizard.WizardPanelDescriptor;

public class ClientMain {
    public static void main(String[] args) {
        
        Wizard wizard = new Wizard();
        wizard.getDialog().setTitle("Vote client");
        
        WizardPanelDescriptor wpDescriptor = new WelcomePanelDescriptor();
        wizard.registerWizardPanel(WelcomePanelDescriptor.IDENTIFIER, wpDescriptor);
        
        WizardPanelDescriptor pdpDescriptor = new PersonalDataPanelDescriptor();
        wizard.registerWizardPanel(PersonalDataPanelDescriptor.IDENTIFIER, pdpDescriptor);

        WizardPanelDescriptor rcpDescriptor = new RegistrationCompletePanelDescriptor();
        wizard.registerWizardPanel(RegistrationCompletePanelDescriptor.IDENTIFIER, rcpDescriptor);
        
        WizardPanelDescriptor pvpDescriptor = new PreVotePanelDescriptor();
        wizard.registerWizardPanel(PreVotePanelDescriptor.IDENTIFIER, pvpDescriptor);
        
        WizardPanelDescriptor vpDescriptor = new VotePanelDescriptor();
        wizard.registerWizardPanel(VotePanelDescriptor.IDENTIFIER, vpDescriptor);
        
        WizardPanelDescriptor avpDescriptor = new AfterVotePanelDescriptor();
        wizard.registerWizardPanel(AfterVotePanelDescriptor.IDENTIFIER, avpDescriptor);
        
        WizardPanelDescriptor prpDescriptor = new PublicateResultsPanelDescriptor();
        wizard.registerWizardPanel(PublicateResultsPanelDescriptor.IDENTIFIER, prpDescriptor);
        
        wizard.setCurrentPanel(WelcomePanelDescriptor.IDENTIFIER);
        //wizard.setCurrentPanel(RegistrationCompletePanelDescriptor.IDENTIFIER);
        int r;
        wizard.getDialog().setSize(600, 400);
        r = wizard.showModalDialog(true);
//        System.out.println("Dialog return code is (0=Finish,1=Cancel,2=Error): " + r);
//        System.out.println("Second panel selection is: " + 
//            (((TestPanel2)descriptor2.getPanelComponent()).getRadioButtonSelected()));
        
        System.exit(0);
        
    }
}
